const gitLogContainer = document.getElementById('git-log-container');

function buildGitLog() {
    if (!config.showGitLog) {
        gitLogContainer.innerHTML = ''
        return
    }
    const titleContainerDom = buildExTitle('Git 提交记录')

    const ulDom = document.createElement('ul')
    ulDom.className = 'git-log-ul'
    const currentGitLogList = vueGitLogMap[vueNames[currentSideIndex]]
    const liList = []
    for (let logInfo of currentGitLogList) {
        const liDom = document.createElement('li')
        liDom.className = 'git-log-li'
        liDom.innerHTML = `<span class="git-log-author">${logInfo.author}</span><span class="git-log-date">${formatDate(logInfo.date)}</span><span class="git-log-message">${logInfo.message}</span>`
        liList.push(liDom)
    }
    ulDom.append(...liList)
    gitLogContainer.innerHTML = ''
    gitLogContainer.append(titleContainerDom, ulDom)
}

buildGitLog()
